package com.webbei.HAO.action;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionSupport;
import com.webbei.HAO.service.ChSer;
import com.webbei.myCustom.action.MyUtil;
import com.webbei.pojo.Customer;

public class Update extends ActionSupport {

	private ChSer ser;

	private Integer userid;
	private String username;
	private String realname;
	private String sex;

	private String provaice;
	private String city;
	private String area;

	private String address;
	private String telphone;
	private String phone1;
	private String phone2;

	private String personalSign;
	public String execute() {
		System.out.println("进入UpdateAction");
		String username = (String) ServletActionContext.getContext().getSession().get("username");

		provaice = MyUtil.getChineseType(provaice);
		city =MyUtil.getChineseType(city);
		area=MyUtil.getChineseType(area);

		Customer cus = new Customer();
		cus.setUserId(userid);
		cus.setUserRealName(realname);
		cus.setUserSex(sex);
		cus.setUserProvince(provaice);
		cus.setUserCity(city);
		cus.setUserArea(area);
		cus.setUserAddress(address);
		cus.setUsertelePhone(phone1 + "-" + phone2);
		cus.setUserMobilePhone(telphone);
		System.out.println(cus);
		ser.update(cus);
		System.out.println(personalSign);
		ser.updatePersonalSign(username,personalSign);
		return SUCCESS;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getRealname() {
		return realname;
	}

	public void setRealname(String realname) {
		this.realname = realname;
	}

	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}


	public String getProvaice() {
		return provaice;
	}

	public void setProvaice(String provaice) {
		this.provaice = provaice;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getTelphone() {
		return telphone;
	}

	public void setTelphone(String telphone) {
		this.telphone = telphone;
	}

	public String getPhone1() {
		return phone1;
	}

	public void setPhone1(String phone1) {
		this.phone1 = phone1;
	}

	public String getPhone2() {
		return phone2;
	}

	public void setPhone2(String phone2) {
		this.phone2 = phone2;
	}

	public ChSer getSer() {
		return ser;
	}

	public void setSer(ChSer ser) {
		this.ser = ser;
	}



	public Integer getUserid() {
		return userid;
	}

	public void setUserid(Integer userid) {
		this.userid = userid;
	}

	public String getArea() {
		return area;
	}

	public void setArea(String area) {
		this.area = area;
	}


	public String getPersonalSign() {
		return personalSign;
	}

	public void setPersonalSign(String personalSign) {
		this.personalSign = personalSign;
	}

}
